package com.yl.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xiaoleilu.hutool.util.StrUtil;
import com.yl.model.TActOrder;
import com.yl.pay.UnionPay;
import com.yl.result.APIException;
import com.yl.service.TActOrderService;
import com.yl.utils.UnionPayUtil;
import com.yl.vo.UserVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
import java.util.Map;


@Controller
@RequestMapping("/")
@Slf4j
public class PageController {


    /**
     * 统一页面controller
     * @return
     */
    /*@RequestMapping(value = "/html/**", method = RequestMethod.GET)
    @ResponseBody
    public String html(HttpServletRequest request) {
        String ss = StrUtil.removePrefix(request.getRequestURI(), request.getContextPath() + "/html");
        log.info(ss);
        //return ss;
        return "index";
    }*/

    @RequestMapping("index")
    @ResponseBody
    public String index() {
        //return new ModelAndView();
        return "html/index";
    }

    @RequestMapping("index2")
    @ResponseBody
    public ModelAndView index2() {
        log.info("index2");
        return new ModelAndView("html/index");
    }

}
